#include"../mqcommon/helper.hpp"

int main()
{

    ljhmq::FileHelper helper("../mqcommon/logger.hpp");
    DLOG("是否存在： %d",helper.exists());
    size_t fsize=helper.size();
     DLOG("文件大小：%d",fsize);

     ljhmq::FileHelper tmp_helper("./aaa/bbb/ccc/tmp.hpp");
     if(tmp_helper.exists()==false)
     {
         std::string path = ljhmq::FileHelper::parentDirectory("./aaa/bbb/ccc/tmp.hpp");
              if(ljhmq::FileHelper(path).exists()==false)
              {
                  ljhmq::FileHelper::createDirectory(path);
              }
              ljhmq::FileHelper::createFile("./aaa/bbb/ccc/tmp.hpp");
     }
     std::string body;
     helper.read(body);
     DLOG("读取的数据[%s]", body.c_str());
     char str[16]={0};
     helper.read(str,8,11);
     DLOG("局部读取数据[%s]",str);

     tmp_helper.write(body);
    // DLOG("写入数据[%s]",str);
     tmp_helper.write("1234567890",8,11);

     tmp_helper.rename("./aaa/bbb/ccc/test.hpp");

     ljhmq::FileHelper::removeFile("./aaa/bbb/ccc/test.hpp");
     ljhmq::FileHelper::removeDirectory("./aaa");
     return 0;
}